<style>
<!--
td.inforvbar:hover{
	background-image:url('<?php echo $this->webroot;?>img/lam/button-background.png') ;
	background-color: #82AAE2;
	background-repeat:repeat-x;
	font-weight: bold;
}
-->
</style>
<div class="posts index">
	<div class="hdr-bg"> 
		<div style=" color: #4697F6; font: bold 17px Arial,san-serif;">&nbsp;<strong> KẾT QUẢ TÌM KIẾM </strong></div> 
		<div style="display: block; background-color: #6BA4E6; height: 3px; overflow: hidden;"></div>
	</div> 
	<br />									
	<!-- Tin rao moi nhat --> 
											
	<table border="0" cellpadding="5" cellspacing="0" width="100%" class="add"> 
		<tbody>
			<tr> 
				<td class="section_subtitle" align="center" width="50"><b>Loại</b></td> 
				<td class="section_subtitle" style="padding-left: 5px;"><b>Tin rao</b></td> 
				<td class="section_subtitle" style="padding-left: 5px;"><b>Lượt xem</b></td> 				
				<td class="section_subtitle" style="padding-left: 5px;" align="center"><b>Ngày đăng</b></td> 
				<td class="section_subtitle" style="padding-left: 5px;" align="center"><b>Nơi đăng</b></td> 				
			</tr>  
			<?php
			$i = 0;
			foreach ($kq as $post):
				$class = null;
				if ($i++ % 2 == 0) {
				$class = ' bgcolor="#f6fbff" height="20" ';
			}
			?>
			<tr <?php echo $class ; ?>> 
				<td class="inforvbar" align="center">
					<a href="#">
						<div class="imgborder"><img src="<?php echo $this->webroot; ?>img/post/types/<?php echo $post['Type']['image'];?>" border="0" height="14" width="14"></div>
					</a>
				</td>
						
				<td class="inforvbar" style="padding-left: 5px; vertical-align: top;"> 
					
					<span style="padding-left : 3px ; padding-right : 3px "><?php echo $html->link($post['Post']['title'], array('controller' => 'posts', 'action' => 'view', $post['Post']['id']), array('id' => 'rvtitle')) ; ?></span>
					<font style="font-weight: normal; color: rgb(0, 128, 0);"> (<?php echo count($post['Comment']) ; ?>) </font> 
					<span style="position: absolute; margin-top: 2px;"></span><br> 
				</td> 

				
				 <td class="inforvbar" align="center" width="80">
					<?php echo $post['Post']['count']; ?>
				</td>
				
				<td class="inforvbar" align="center" width="80">
					<?php echo date( "d/m/Y" , strtotime($post['Post']['created'])); ?>
				</td>
				
				<td class="inforvbar" align="center" width="80">
					<?php echo $post['City']['name']; ?>
				</td>
			</tr>  
			<?php endforeach; ?>										
		</tbody>
	</table> 

	<br />
		<div class="paging" style="text-align: right;">
		<?php echo $this->Paginator->prev('<< ' . __('Lui', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('tới', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
	<div class="legend"> 
		<h6>Chú thích >></h6> 
		<div class="chars"> 
			<div>
				<span class="adtypeB"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/1.gif" border="0" height="14" width="14">= Cần bán
			</div> 
			<div>
				<span class="adtypeM"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/2.gif" border="0" height="14" width="14">= Cần mua
			</div> 
			<div style="display: none;">
				<span class="adtypeH"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/3.gif" border="0" height="14" width="14">= Hợp tác - Cộng tác
			</div>
		</div>		
		<div class="chars"> 
			<div>
				<span class="adtypeQ"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/4.gif" border="0" height="14" width="14">= Quảng cáo
			</div> 
			<div>
				<span class="adtypeR"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/5.gif" border="0" height="14" width="14">= Rao vặt
			</div> 
			<div>
				<span class="adtypeV"> </span>
				<img src="<?php echo $this->webroot; ?>img/post/types/6.gif" border="0" height="14" width="14">= Việc làm
			</div>
		</div>
	</div> 
</div>
<script>
function filter(){
	url = "<?php echo $this->webroot;?>posts/index/" + $('#ca_id').val() + "/" + $('#ci_id').val() ;
	window.location = url;
}
</script>